/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jsf.view;

import com.jsf.entity.OtherUser;
import com.jsf.service.UserService;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.view.ViewScoped;

/**
 *
 * @author Admin
 */
@ManagedBean(name="otherUserView")
@ViewScoped
public class OtherUserView extends PageViewBean implements Serializable{
    private List<OtherUser> users;
    
    @ManagedProperty("#{userService}")
    private UserService service;
    
    @PostConstruct
    public void init() {
        System.out.println("com.mycompany.views.UserView.init()");
        users = service.createUser();
    }
    
    public List<OtherUser> getUsers() {
        return users;
    }
    
    public void setService(UserService service) {
        this.service = service;
    } 
}

